home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1991-1995 by TopSoft Inc. All rights reserved.
-
- You may distribute this file under the terms of the TopSoft
- Artistic License, accompanying this package.
-
- This file was created & modified by George (ty) Tempel in
- connection with TopSoft, Inc. from Apple DTS source code:
-
- Apple Macintosh Developer Technical Support
-
- A collection of useful high-level File Manager routines.
-
- by Jim Luther, Apple Developer Technical Support
-
- from File: MoreFilesExtras.c
-
- Copyright © 1992-1994 Apple Computer, Inc.
- All rights reserved.
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- See the Modification History for more details.
-
- Product
- About Box
-
- FILE
- ABUFSSpecs.c
-
- NAME
- ABUFSSpecs.h, part of the ABox project source code,
- responsible for utility handling the AboutBox FSSpecs stuff.
-
- DESCRIPTION
- This file contains defines and prototypes for the ABUFSSpecs
- utility class.
-
- DEVELOPED BY
- George (ty) Tempel netromancr@aol.com
- All code in this file, and its associated header file was
- Created by George (ty) Tempel in connection with the TopSoft, Inc.
- "FilterTop" application development, except where noted.
-
- CARETAKER - George (ty) Tempel <netromancr@aol.com>
- Please consult this person for any changes or suggestions to this file.
-
- MODIFICATION HISTORY
-
- dd mmm yy - xxx - patchxx: description of patch
- 15 july 94 - ty - Initial Version Created
- 20-july-94 - ty - initial version released
- 23-may-95 - ty - changes for compatibility with the CodeWarrior CW6
- release and the associated Universal Headers from Apple:
- most methods that returned references now have "Ref" at
- the end of their methods names to prevent possible collisions
- with datatypes and classes of the same name (older versions
- of the compiler didn't have a problem with this).
-
- */
-
-
- /*****************************************************************************/
-
- class ABUFSSpecs
- {
- public:
- ABUFSSpecs(void);
- virtual ~ABUFSSpecs(void);
-
- static pascal OSErr GetDirID(short vRefNum,
- long dirID,
- StringPtr name,
- long *theDirID,
- Boolean *isDirectory);
- /* Use GetDirID to get the directory ID number of the directory
- specified. If a file is specified, then the parent
- directory of the file is returned and isDirectory is false. If
- a directory is specified, then that directory's ID number is
- returned and isDirectory is true.
- WARNING: Volume names on the Macintosh are *not* unique -- Multiple
- mounted volumes can have the same name. For this reason, the use of a
- volume name or full pathname to identify a specific volume may not
- produce the results you expect. If more than one volume has the same
- name and a volume name or full pathname is used, the File Manager
- currently uses the first volume it finds with a matching name in the
- volume queue.
-
- vRefNum input: Volume specification.
- dirID input: Directory ID.
- name input: Pointer to object name, or nil when dirID
- specifies a directory that's the object.
- theDirID output: If the object is a file, then its parent directory
- ID. If the object is a directory, then its ID.
- isDirectory output: True if object is a directory; false if
- object is a file.
- */
-
-
- static pascal OSErr DirIDFromFSSpec(const FSSpec *spec,
- long *dirID,
- Boolean *isDirectory);
- /* Use DirIDFromFSSpec to get the directory ID number of the directory
- specified by spec. If spec is to a file, then the parent
- directory of the file is returned and isDirectory is false. If
- spec is to a directory, then that directory's ID number is
- returned and isDirectory is true.
-
- spec input: An FSSpec record specifying the directory.
- theDirID output: The directory ID.
- isDirectory output: True if object is a directory; false if
- object is a file.
- */
-
-
- static pascal OSErr DetermineVRefNum(StringPtr pathname,
- short vRefNum,
- short *realVRefNum);
- /* Use DetermineVRefNum to determine the volume reference number of a
- volume from a pathname, a volume specification, or a combination
- of the two.
- WARNING: Volume names on the Macintosh are *not* unique -- Multiple
- mounted volumes can have the same name. For this reason, the use of a
- volume name or full pathname to identify a specific volume may not
- produce the results you expect. If more than one volume has the same
- name and a volume name or full pathname is used, the File Manager
- currently uses the first volume it finds with a matching name in the
- volume queue.
-
- pathName input: Pointer to a full pathname or nil. If you pass in a
- partial pathname, it is ignored. A full pathname to a
- volume must end with a colon character (:).
- vRefNum input: Volume specification (volume reference number, working
- directory number, drive number, or 0).
- realVRefNum output: The real volume reference number.
- */
-
-
- static pascal OSErr GetDirItems(short vRefNum,
- long dirID,
- StringPtr name,
- Boolean getFiles,
- Boolean getDirectories,
- FSSpecPtr items,
- short reqItemCount,
- short *actItemCount,
- short *itemIndex);
- /* Use GetDirItems to return a list of items in a directory.
-
- vRefNum input: Volume specification.
- dirID input: Directory ID.
- name input: Pointer to object name, or nil when dirID
- specifies a directory that's the object.
- getFiles input: Pass true to have files added to the items list.
- getDirectories input: Pass true to have directories added to the
- items list.
- items input: Pointer to array of FSSpec where the item list
- is returned.
- reqItemCount input: Maximum number of items to return (the number
- of elements in the items array).
- actItemCount output: The number of volumes actually returned.
- itemIndex input: The current item index position. Set to 1 to
- start with the first item in the directory.
- output: The item index position to get the next item.
- Pass this value the next time you call
- GetDirItems to start where you left off.
- */
-
- };
-
-
- // end of file.